<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>position-fixed</title>
    <link rel="stylesheet" href="./reset.css">
    <style>
    body {
        height: 800px;
        background: blue;
    }

    .block {
        width: 80px;
        height: 80px;
        line-height: 80px;
        text-align: center;
        border: 2px solid black;
    }

    .block:nth-child(1) {
        position: relative;
        top: 10px;
        left: 20px;
    }

    .block:nth-child(2) {
        position: fixed;
        top: 10px;
        left: 20px;
    }
    </style>
</head>

<body>
    <div class="block">绝对定位</div>
    <div class="block">固定定位</div>
</body>

</html>